home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / cmds / makedepend.man < prev    next >
Encoding:
Text File  |  1991-12-02  |  6.4 KB  |  146 lines

  1. ' Copyright 1989 Regents of the University of California
  2. ' Permission to use, copy, modify, and distribute this
  3. ' documentation for any purpose and without fee is hereby
  4. ' granted, provided that this notice appears in all copies.
  5. ' The University of California makes no representations about
  6. ' the suitability of this material for any purpose.  It is
  7. ' provided "as is" without express or implied warranty.
  8. ' $Header: /sprite/src/attcmds/makedepend/RCS/makedepend.man,v 1.3 91/12/02 14:04:15 shirriff Exp $ SPRITE (Berkeley)
  9. .so \*(]ltmac.sprite
  10. .HS MAKEDEPEND cmds
  11. .BS
  12. .SH NAME
  13. makedepend \- Generate dependency list for make
  14. .SH SYNOPSIS
  15. \fBmakedepend\fR [\fIoptions\fR] \fIfile file ...\fR
  16. .SH OPTIONS
  17. .IP "\fB\-D \fIdef\fR" 20
  18. Define a macro.  This argument has the same meaning as the corresponding
  19. argument to \fBcc\fR.
  20. .IP "\fB\-f \fImakefile\fR" 20
  21. Use \fImakefile\fR as the makefile to modify.  If \fImakefile\fR
  22. is ``\-'', \fBmakedepend\fR will simply print dependency information
  23. on standard output.  \fIMakefile\fR defaults to \fBmakefile\fR if
  24. it exists, otherwise \fBMakefile\fR.
  25. .IP "\fB\-I \fIincludeDir\fR" 20
  26. Search for include files in \fIincludeDir\fR before looking in the
  27. default system directories.  If there are many \fB\-I\fR arguments,
  28. the directories are searched in the same order as the arguments.
  29. .IP "\fB\-m \fItm\fR" 20
  30. Use \fItm\fR as the target machine for generating dependencies.
  31. The target machine determines where \fBmakedepend\fR looks for
  32. machine-dependent header files (see below).  If this option is
  33. not specified, the target machine defaults to the value of the
  34. \fB$MACHINE\fR environment variable.
  35. .IP "\fB\-o \fIsuffix\fR" 20
  36. Use \fIsuffix\fR as the suffix for the ``object'' files listed in
  37. the output.  If this argument is not specified, the suffix defaults
  38. to \fB.o\fR.
  39. .IP "\fB\-p\fR" 20
  40. Output the full path name for each include file.  If this switch
  41. isn't specified, then only the include file name given in the
  42. \fB#include\fR statement is output.
  43. .IP "\fB\-s \fIstring\fR" 20
  44. If this switch is given, \fIstring\fR specifies the comment string
  45. that identifies the beginning of dependencies in the makefile.
  46. \fIString\fR must start with the comment character ``#''.
  47. .IP "\fB\-v\fR" 20
  48. Verbose mode.  For each file included by one of the \fIfile\fRs,
  49. output a sequence of comment lines that list the other include
  50. files included by that include file.
  51. .IP "\fB\-w \fIwidth\fR" 20
  52. Try to arrange for output lines not to contain more than \fIwidth\fR
  53. characters total.  If a single \fIfile\fR has multiple dependencies
  54. then they will be grouped onto a single line in the output file unless
  55. this grouping would cause the output line to exceed \fIwidth\fR characters
  56. in length.
  57. .BE
  58.  
  59. .SH DESCRIPTION
  60. .LP
  61. \fBMakedepend\fR is a program that generates dependency lines for
  62. makefiles.  It reads a collection of C source files given by the
  63. \fIfile\fR arguments and generates a collection of lines each
  64. having the form
  65. .DS
  66. \fBfile.o:\ \ \ x.h\ \ \ y.h\ \ \ /a/b/c.h\fR
  67. .DE
  68. .LP
  69. These dependency lines describe all of the include files used
  70. directly or indirectly in compiling each source \fIfile\fR.
  71. .LP
  72. \fBMakedepend\fR normally inserts the dependency lines into the
  73. file \fBmakefile\fR if it exists, or \fBMakefile\fR otherwise
  74. (see the \fB\-f\fR option for other alternatives).  To insert the
  75. dependencies in a makefile, \fBmakedepend\fR searches the makefile
  76. for a trigger line.  Usually the trigger line is
  77. .DS C
  78. \fB# DO NOT DELETE THIS LINE -- make depend depends on it.\fR
  79. .DE
  80. .LP
  81. but a different trigger string may be selected with the \fB\-s\fR
  82. switch.  \fBMakedepend\fR locates the trigger line, deletes all of
  83. the information after the trigger line, and replaces it with the
  84. dependency lines.  A backup copy of the original makefile is saved
  85. in \fImakefile\fB.bak~\fR, where \fImakefile\fR is the name of the
  86. original makefile.
  87. .LP
  88. \fBMakedepend\fR duplicates the actions of \fBcc\fR in determining
  89. which include files are required for each \fIfile\fR.  It normally
  90. checks for include files in the current directory, then in
  91. \fB/sprite/lib/include\fR, then in \fB/sprite/lib/include/\fItm\fB.md\fR
  92. (where \fItm\fR is the target machine being compiled for;  this is
  93. either the value of the \fB$MACHINE\fR environment variable or
  94. the value given in the \fB\-m\fR option).  If \fB\-I\fR options are
  95. given, then those directories are searched before the standard system
  96. directories.  \fBMakedepend\fR processes conditional compilation
  97. statements such as \fB#define\fR and \fB#ifdef\fR in a fashion similar
  98. to the C preprocessor in order to consider only the include files that
  99. would be processed by the C compiler.  You should pass the same \fB\-D\fR
  100. options to \fBmakedepend\fR that you would give to \fBcc\fR.
  101. .VS
  102. \fBMakedepend\fR can also deal with \fB#if\fR and \fB#elif\fR directive, 
  103. except that the
  104. only allowable expressions are \fBdefined(\fIfoo\fB)\fR and 
  105. \fB!defined(\fIfoo\fB)\fR. 
  106. Any
  107. other expression will evaluate to false.
  108. .VE
  109. .LP
  110. There are several options that control the formatting of the dependency
  111. lines.  Normally, the first field of each output line is \fIx\fB.o\fR,
  112. where \fIx\fR is one of the \fIfile\fR arguments with the \fB.c\fR or
  113. any other suffix stripped off.  However, the \fB\-o\fR option may be used
  114. to place a suffix other than \fB.o\fR in the output lines.  The \fB\-p\fR
  115. option controls how completely the include file names are specified in
  116. the output.  If \fB\-p\fR is given, then the complete path name of each
  117. header file is output.  If \fB-p\fR is not given, then
  118. only the name from the actual \fB#include\fR statement is output
  119. (e.g., \fBsys/file.h\fR instead of \fB/sprite/lib/include/sys/file.h\fR).
  120. This default is useful for Pmake, which manages its own include file
  121. search path.  Finally, the \fB\-w\fR switch may be used to control the
  122. length of the output lines, and the \fB\-v\fR switch causes extra
  123. information about nested includes to be output in the form of comment
  124. lines.
  125.  
  126. .SH "SEE ALSO"
  127. mkmf, pmake
  128.  
  129. .SH BUGS
  130. .VS
  131. .LP
  132. Can't handle arbitrary expressions following \fB#if\fR or \fB#elif\fR.
  133. .LP
  134. Makedepend's algorithm can cause problems in some cases.  It only parses
  135. each include file once and generates a list of dependencies for that file.
  136. However, if defines are set differently, it could be that an include file
  137. will depend on two different sets of files in two different invocations.
  138. In this case, makedepend will return the wrong dependencies for the second
  139. case.
  140. .VE
  141.  
  142. .SH KEYWORDS
  143. dependencies, include file, object file
  144.